{% set pypi_name = 'openstack-doc-tools' %}
{% set upstream_version = upstream_version('3.3.0') %}
{% set rpm_release = '1' %}
{% set source = url_pypi() %}
%global module os_doc_tools
Name:           {{ py2name() }}
Version:        {{ py2rpmversion() }}
Release:        {{ py2rpmrelease() }}
Summary:        OpenStack Docs Tools
License:        {{ license('Apache-2.0') }}
Group:          Development/Languages/Python
URL:            https://docs.openstack.org/{{ pypi_name }}
Source0:        {{ source }}
BuildRequires:  openstack-macros
BuildRequires:  {{ py3('Babel') }}
BuildRequires:  {{ py3('PyYAML') }}
BuildRequires:  {{ py3('Sphinx') }}
BuildRequires:  {{ py3('demjson') }}
BuildRequires:  {{ py3('lxml') }}
BuildRequires:  {{ py3('mock') }}
BuildRequires:  {{ py3('openstackdocstheme') }}
BuildRequires:  {{ py3('pbr') }}
BuildArch:      noarch

%description
Tools used by the OpenStack Documentation Project.

%package -n {{ py2name(py_versions='py3') }}
Summary:        OpenStack Docs Tools
Requires:       {{ py3('PyYAML') }}
Requires:       {{ py3('Sphinx') }}
Requires:       {{ py3('iso8601') }}
Requires:       {{ py3('lxml') }}
Requires:       {{ py3('openstackdocstheme') }}
%if 0%{?suse_version}
Obsoletes:      {{ py2name(py_versions='py2') }} < 1.8.0
%endif

%description -n {{ py2name(py_versions='py3') }}
Tools used by the OpenStack Documentation Project.

This package contains the Python 3.x module.

%prep
%autosetup -n {{ pypi_name }}-%{version}
%py_req_cleanup

%build
%py3_build

%install
%py3_install

%files -n {{ py2name(py_versions='py3') }}
%license LICENSE
%doc README.rst
%{_bindir}/doc-tools-build-rst
%{_bindir}/doc-tools-check-languages
%{python3_sitelib}/%{module}
%{_datadir}/{{ pypi_name }}
%{python3_sitelib}/*.egg-info

%changelog
